package com.sinping.qh.repository.mongo.records;

import com.sinping.qh.domain.records.HiddendangerRecord;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * 隐患记录
 *
 * @author Tiansx
 * @create 2018-05-28 15:19
 **/
public interface HiddenDangerRecordRepository extends MongoRepository<HiddendangerRecord,String> {
    /**
     * 通过检查记录Id，查找隐患记录
     * @param checkId
     * @return
     */
    List<HiddendangerRecord>findAllByCheckId(String checkId);

    /**
     * 通过记录状态，查找隐患记录
     * @param checkStatus
     * @return
     */
    List<HiddendangerRecord>findAllByCheckStatusAndCheckId(String checkStatus,String checkRecordId);

    List<HiddendangerRecord> findHiddendangerRecordsByCheckId(String checkId);

    List<HiddendangerRecord> findHiddendangerRecordsByCheckIdAndHiddenDangerStatusIn(String checkId,List hiddenStatus);

    //查询去重的隐患记录 根据隐患记录id
    List<HiddendangerRecord> findDistinctByCheckLabId(List<String> ids);

    List<HiddendangerRecord> findHiddendangerRecordByCheckIdAndOffline(String checkId,String offLine);
}
